const postModel = require("../model/adminPostModel");
module.exports = {
  getPostByPage(req, res) {
    // console.log(res.body);
    let { pageIndex, pageSize } = req.body;
    postModel.getPostByPage(pageIndex, pageSize, function(err, result) {
      if (err) console.error(err);
      let resObj = {};
      if (result.length > 0) {
        resObj.code = 200;
        resObj.msg = "获取成功";
        resObj.data = result;
      } else {
        resObj.code = 200;
        resObj.msg = "获取失败";
      }
      res.send(resObj);
    });
  }
};
